﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="Yule8xWechat.Agent.Index" %>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>代理首页<%=user_id>0?user_id.ToString():string.Empty %></title>
    <link rel="stylesheet" type="text/css" href="../Skin/Theme/Css/comm.css" />
    <link rel="stylesheet" type="text/css" href="../Skin/Theme/Css/icon.css" />
    <link rel="stylesheet" type="text/css" href="../Skin/Theme/Css/my.css" />
    <link rel="stylesheet" type="text/css" href="../Skin/Theme/Css/agent.css" />
    <link rel="stylesheet" type="text/css" href="../Skin/Theme/Plugins/widget/iscroll/css/iscroll2.css" />
    <script src="../Skin/Theme/Js/flexible_css.js" type="text/javascript" charset="utf-8"></script>
    <script src="../Skin/Theme/Js/flexible.js" type="text/javascript" charset="utf-8"></script>

    <style type="text/css">
        #gongao {
            width: 1000px;
            height: 30px;
            overflow: hidden;
            line-height: 30px;
            font-size: 13px;
            font-family: '宋体';
            background: #DDE5ED;
            color: #0C77CF;
            font-weight: bold;
        }

            #gongao #scroll_begin, #gongao #scroll_end {
                display: inline;
            }
    </style>
</head>

<body>
    <div class="content  b-h" id="content">
        <div id="scroller" class="scroller">
            <div id="pullDown" class="pulldown">
                <div class="pullDownLabel"></div>
            </div>

            <!--头部信息二维码-->
            <!--
    <div id="gongao">
        <div style="width:100%;height:30px;margin:0 auto;white-space: nowrap;overflow:hidden;" id="scroll_div" class="scroll_div">
            <div id="scroll_begin" data-url="/PublicServices/NoticeService.aspx">
                            </div>
            <div id="scroll_end"></div>
        </div>
    </div>
                -->
            <div class="topinfo">
                <a href="QrInfo.aspx">
                    <div class="infoarea">
                        <span class="headimg">
                            <img src="<%=wxUser.headimgurl %>"></span>
                        <span class="nameinfo">
                            <div class="myname"><%=wxUser.nickname %></div>
                            <div class="mygameid">代理ID <%=wxUser.user_id %></div>
                        </span>
                        <span class="detailarrow">
                            <img src="../Skin/Theme/Images/my/arrow.png"></span>
                        <span class="qrimg">
                            <img src="../Skin/Theme/Images/my/qrcode.png"></span>

                    </div>
                </a>
            </div>
            <div class="clear"></div>
            <!--代理数据信息-->
            <div class="adataarea">
                <ul>
                    <li>
                        <a href="../Income/DailyHistory.aspx?date=today&user_id=<%=user_id %>">
                            <div class="dtitle">
                                <span class="timg">
                                    <img src="../Skin/Theme/Images/my/jinri.png"></span><span class="ttitle">今日收入</span>
                            </div>
                            <div class="dcount"><%=pageData.todayAmount %></div>
                        </a>
                    </li>
                    <li>
                        <a href="../Income/DailyHistory.aspx?user_id=<%=user_id %>">
                            <div class="dtitle">
                                <span class="timg">
                                    <img src="../Skin/Theme/Images/my/leiji.png"></span><span class="ttitle">累计收入</span>
                            </div>
                            <div class="dcount"><%=pageData.totalAmount %></div>
                        </a>
                    </li>
                    <li>
                        <a href="Child1Agent.aspx?user_id=<%=user_id %>">
                            <div class="dtitle">
                                <span class="timg">
                                    <img src="../Skin/Theme/Images/agent/level1.png"></span><span class="ttitle">1级代理</span>
                            </div>
                            <div class="dcount"><%=pageData.agent2Count %> 个</div>
                        </a>
                    </li>
                    <li>
                        <a href="Child2Agent.aspx?user_id=<%=user_id %>">
                            <div class="dtitle">
                                <span class="timg">
                                    <img src="../Skin/Theme/Images/agent/level2.png"></span><span class="ttitle">2级代理</span>
                            </div>
                            <div class="dcount"><%=pageData.agent3Count %> 个 </div>
                        </a>
                    </li>
                </ul>
            </div>
            <div class="clear"></div>
            <!--代理数据信息-->
            <div class="adataarea">
                <ul>
                    <li>
                        <a href="../Dimond/History.aspx?user_id=<%=user_id %>">
                            <div class="dtitle">
                                <span class="timg">
                                    <img src="../Skin/Theme/Images/my/zuanshi.png"></span><span class="ttitle">八星钻石</span>
                            </div>
                            <div class="dcount"><%=pageData.dimondCount %> 颗</div>
                        </a>
                    </li>
                    <li>
                        <a href="../WithDraw/Default.aspx?user_id=<%=user_id %>">
                            <div class="dtitle">
                                <span class="timg">
                                    <img src="../Skin/Theme/Images/my/zhanghuyue.png"></span><span class="ttitle">余额<%=pageData.blance %></span>
                            </div>
                            <div class="dcount t-b">我要提现</div>
                        </a>
                    </li>
                </ul>
            </div>
            <div class="clear"></div>
            <!--个人数据信息-->
            
            <!--菜单区域-->
            <div class="menulist">
                <ul>
                    <li class="menudetail">
                        <div class="menucontent">
                            <a href="../Dimond/DimondTransfer.aspx?user_id=<%=user_id %>"><span class="mimg">
                                <img src="../Skin/Theme/Images/my/zengsongfangka.png"></span><span class="mtitle">钻石转入游戏</span><span class="marrow"><img src="../Skin/Theme/Images/my/arrow1.png"></span><span class="smalltip">不可赠送给代理</span></a>
                        </div>
                    </li>
                    <li class="menudetail">
                        <div class="menucontent">
                            <a href="../Payment/WxPay/BuyCard.aspx"><span class="mimg">
                                <img src="../Skin/Theme/Images/my/goumaifangka.png"></span><span class="mtitle">购买钻石</span><span class="marrow"><img src="../Skin/Theme/Images/my/arrow1.png"></span></a>
                        </div>
                    </li>
                </ul>
            </div>

            <div class="menulist">
                <ul>
                    <li class="menudetail">
                        <div class="menucontent">
                            <a href="../Income/Default.aspx?user_id=<%=user_id %>"><span class="mimg">
                                <img src="../Skin/Theme/Images/my/shourushuju.png"></span><span class="mtitle">收入详情</span><span class="marrow"><img src="../Skin/Theme/Images/my/arrow1.png"></span></a>
                        </div>
                    </li>
                    <li class="menudetail">
                        <div class="menucontent">
                            <a href="../Recharge/History.aspx?user_id=<%=user_id %>"><span class="mimg">
                                <img src="../Skin/Theme/Images/my/chongzhijilu.png"></span><span class="mtitle">充值详情</span><span class="marrow"><img src="../Skin/Theme/Images/my/arrow1.png"></span></a>
                        </div>
                    </li>
                    <li class="menudetail">
                        <div class="menucontent">
                            <a href="ChildUser.aspx?user_id=<%=user_id %>"><span class="mimg">
                                <img src="../Skin/Theme/Images/my/tuiguanguser.png"></span><span class="mtitle">推广玩家详情</span><span class="marrow"><img src="../Skin/Theme/Images/my/arrow1.png"></span><span class="smalltip">推广一个用户送2颗钻石</span></a>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="menulist">
                <% if (!isDrawFreeDiamond)
                    { %>
                <ul>
                    <li class="menudetail">
                        <div class="menucontent">
                            <a href="../Promotion/GetFreeDiamond.aspx?user_id=<%=user_id %>"><span class="mimg">
                                <img src="../Skin/Theme/Images/my/mianfeizuanshi.png"></span><span class="mtitle">免费领取钻石</span><span class="marrow"><img src="../Skin/Theme/Images/my/arrow1.png"></span></a>
                        </div>
                    </li>
                </ul>
                <%} %>
                <div id="pullUp" class="pullup">
                    <div class="pullUpLabel">
                        <img src="../widget/iscroll/images/rolling.svg" />加载更多...
                    </div>
                </div>
            </div>

            <!--菜单区域-->
        </div>
    </div>
    
            <% 
                // 1038 唐威程 不知道为什么，整个页面会空白，把以下特效停止就可以正常显示了
                if (wxUser.user_id == 1038) { Response.End(); } 
                %>
    <script src="../Skin/Theme/Js/jquery_2.1.3.js" type="text/javascript" charset="utf-8"></script>
    <script src="../Skin/Theme/Plugins/widget/iscroll/js/iscroll-probe.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            loaded();
        })
        $("#warning-block").show();
        var myScroll;
        var pullDownEl, pullDownL;
        var pullUpEl, pullUpL;
        var Downcount = 0, Upcount = 0;
        var loadingStep = 0;//加载状态0默认，1显示加载状态，2执行加载数据，只有当为0时才能再次加载，这是防止过快拉动刷新

        function pullDownAction() {//下拉事件
            setTimeout(function () {
                location.reload();
            }, 100); //1秒
        }
        function pullUpAction() {//上拉事件
            setTimeout(function () {
                var el, li, i;
                el = $('#add');
                for (i = 0; i < 3; i++) {
                    li = $("<li></li>");
                    Upcount++;
                    li.text('new Add ' + Upcount + " ！");
                    //程序将新增数据加载到这
                    el.append(li);
                }
                pullUpEl.removeClass('loading');
                pullUpEl['class'] = pullUpEl.attr('class');
                pullUpEl.attr('class', '').hide();
                myScroll.refresh();
                loadingStep = 0;
            }, 100);
        }

        function loaded() {
            pullDownEl = $('#pullDown');
            pullDownL = pullDownEl.find('.pullDownLabel');
            pullDownEl['class'] = pullDownEl.attr('class');
            pullDownEl.attr('class', '').hide();
            pullUpEl = $('#pullUp');
            pullUpL = pullUpEl.find('.pullUpLabel');
            pullUpEl['class'] = pullUpEl.attr('class');
            pullUpEl.attr('class', '').hide();
            myScroll = new IScroll('#content', {
                probeType: 2,//probeType：1对性能没有影响。在滚动事件被触发时，滚动轴是不是忙着做它的东西。probeType：2总执行滚动，除了势头，反弹过程中的事件。这类似于原生的onscroll事件。probeType：3发出的滚动事件与到的像素精度。注意，滚动被迫requestAnimationFrame（即：useTransition：假）。
                scrollbars: true,//有滚动条
                mouseWheel: true,//允许滑轮滚动
                fadeScrollbars: true,//滚动时显示滚动条，默认影藏，并且是淡出淡入效果
                bounce: true,//边界反弹
                interactiveScrollbars: true,//滚动条可以拖动
                shrinkScrollbars: 'scale',// 当滚动边界之外的滚动条是由少量的收缩。'clip' or 'scale'.
                click: true,// 允许点击事件
                keyBindings: true,//允许使用按键控制
                momentum: true// 允许有惯性滑动
            });
            //滚动时
            myScroll.on('scroll', function () {
                if (loadingStep == 0 && !pullDownEl.attr('class').match('flip|loading') && !pullUpEl.attr('class').match('flip|loading')) {
                    if (this.y > 10) {
                        //下拉刷新效果
                        pullDownEl.attr('class', pullUpEl['class'])
                        pullDownEl.show();
                        myScroll.refresh();
                        pullDownEl.addClass('flip');
                        loadingStep = 1;
                    }
                }
            });
            //滚动完毕
            myScroll.on('scrollEnd', function () {
                if (loadingStep == 1) {
                    if (pullUpEl.attr('class').match('flip|loading')) {
                        pullUpEl.removeClass('flip').addClass('loading');
                        loadingStep = 2;
                    } else if (pullDownEl.attr('class').match('flip|loading')) {
                        pullDownEl.removeClass('flip').addClass('loading');
                        loadingStep = 2;
                        pullDownAction();
                    }
                }
            });
        }
        document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
    </script>
    <script type="text/javascript">

        function ScrollImgLeft() {
            var speed = 50;
            var scroll_begin = document.getElementById("scroll_begin");
            var scroll_end = document.getElementById("scroll_end");
            var scroll_div = document.getElementById("scroll_div");
            scroll_end.innerHTML = scroll_begin.innerHTML;
            function Marquee() {
                if (scroll_end.offsetWidth - scroll_div.scrollLeft <= 0)
                    scroll_div.scrollLeft -= scroll_begin.offsetWidth;
                else
                    scroll_div.scrollLeft++;
            }
            var MyMar = setInterval(Marquee, speed);
            scroll_div.onmouseover = function () { clearInterval(MyMar); }
            scroll_div.onmouseout = function () { MyMar = setInterval(Marquee, speed); }
        }
        function getnotices() {
            var $dom = $('#scroll_begin');
            $dom.load($dom.data('url'), function (data) {
                if (!data) {
                    return;
                }
                data = $.parseJSON(data);
                var str = '';
                for (var i in data) {
                    str += data[i] + "&nbsp;&nbsp;";
                }
                $dom.html(str);
                if (!$dom.data('first')) {
                    $dom.data('first', true);
                    ScrollImgLeft();
                }
            })
        }
        //getnotices();
        //setInterval(getnotices, 60000);
    </script>
</body>

</html>
